package com.design.patterns.list.singleton;

/**
 * 单例模式：懒汉式
 * @author Wangzhiwen
 */
public class SingletonC {

}

class Singleton2{

    private Singleton2(){}

    private static Singleton2 SINGLETON;

    /**
     * 线程不安全
     */
    public static Singleton2 getInstance(){
        if (SINGLETON == null){
            SINGLETON = new Singleton2();
        }
        return SINGLETON;
    }


}
